home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / sem_wait.z / sem_wait
Encoding:
Text File  |  1998-10-20  |  3.7 KB  |  66 lines

  1.  
  2.  
  3.  
  4. sssseeeemmmm____wwwwaaaaiiiitttt((((3333CCCC))))                                                      sssseeeemmmm____wwwwaaaaiiiitttt((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt, _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt - acquire a posix named or unnamed semaphore
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_eeee_mmmm_aaaa_pppp_hhhh_oooo_rrrr_eeee_...._hhhh_>>>>
  13.      _iiii_nnnn_tttt _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt_((((_ssss_eeee_mmmm______tttt _****_s_e_m_))))_;;;;
  14.      _iiii_nnnn_tttt _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt_((((_ssss_eeee_mmmm______tttt _****_s_e_m_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt atomically decrements the value of the semaphore located at
  18.      address _s_e_m.  If the semaphore's value is less than zero after the
  19.      decrement, the calling process blocks on the semaphore.  Otherwise, the
  20.      calling process continues without blocking.
  21.  
  22.      A process blocked on a semaphore remains blocked until either another
  23.      process posts the semaphore via _ssss_eeee_mmmm______pppp_oooo_ssss_tttt, or the _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt operation is
  24.      interrupted by a signal.
  25.  
  26.      _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt atomically decrements the semaphore _oooo_nnnn_llll_yyyy if the resulting
  27.      value is greater than or equal to zero.  This way, the _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt
  28.      function will never cause the calling process to block on the semaphore.
  29.  
  30.      The address _s_e_m may reside anywhere in the calling processes address
  31.      space, but the process must have read and write access to _s_e_m.
  32.  
  33.      _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt or _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt will fail if one or more of the following are
  34.      true:
  35.  
  36.      [EAGAIN]    _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt will generate this error if the semaphore was not
  37.                  available.
  38.  
  39.      [EDEADLK]   A deadlock condition was detected.
  40.  
  41.      [EINVAL]    The semaphore located at address _s_e_m is not a valid posix
  42.                  named or unnamed semaphore.
  43.  
  44.      [EINTR]     The operation was interrupted by a signal.
  45.  
  46. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  47.      sem_init(3C), sem_destroy(3C), sem_getvalue(3C), sem_post(3C),
  48.      sem_wait(3C), sem_trywait(3C), sem_open(3C), sem_close(3C),
  49.      sem_unlink(3C),
  50.  
  51. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  52.      Upon successful completion, a value of 0 is returned to the calling
  53.      process. Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to
  54.      indicate the error.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.